﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Administrator/Views/Shared/AdminMasterPage.master" Inherits="System.Web.Mvc.ViewPage<easyccms.WebUI.Areas.Administrator.Models.UserListModel>" %>
<%@ Import Namespace="easyccms.BusinessLayer.Entities" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
   
    <div class="page-title ui-widget-content ui-corner-all">
        <div class="float-right">&nbsp;</div>
        <h1><b>User Management</b></h1>
        <div class="other">
            <div class="hastable">
                <table id="Table1">
                    <thead>
                        <tr>
                            <th>
                                #
                            </th>
                            <th>
                                Email
                            </th>
                           <th>
                            Name Surname</th>
                            <th>
                                Last login date
                            </th>
                            <th>
                                User group
                            </th>
                            <th>Locked out</th>
                            <th>
                                ID
                            </th>
                            <th style="width: 100px">
                                Options
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        <%
                            int i = 0;
                        %>
                        <% foreach (SiteUser item in Model.Users)
                           {
                               i++; 
                        %>
                        <tr <%= (i/2==0)?"class=\"even\"":"class=\"odd\"" %>>
                            <td>
                                <%= i++ %>
                            </td>
                            <td>
                            
                           <%= item.Email%>
                            </td>
                            <td>
                                <%=
                string.Format("{0} {1}", item.UserProfile.Name, item.UserProfile.Surname)%>
                            </td>
                            <td>
                                <%= ((DateTime)item.LastLoginDate).ToShortDateString()%>
                            </td>
                            <td>
                                <%= item.UserGroup.GroupName %>
                            </td>
                            <td><%= item.LockedOut %></td>
                            <td>
                                <%= item.UserId %>
                            </td>
                            <td>
                                <%: Html.ActionLink("Edit", "Edit", new { id = item.UserId })%>
                                |
                                <%: Html.ActionLink("Delete", "Delete", new { id = item.UserId })%>
                            </td>
                        </tr>
                        <% } %>
                    </tbody>
                </table>
            </div>
            <div class="clearfix">
            </div>
        </div>
    </div>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadPlaceHolder" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="JavaScriptHolder" runat="server">
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
</asp:Content>

